libxc/libxl: sanitize error handling in *_get_max_{cpus, nodes}
authorDario Faggioli <dario.faggioli@citrix.com>
Sat, 7 Dec 2013 00:05:03 +0000 (01:05 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 9 Dec 2013 15:20:12 +0000 (15:20 +0000)
commit2e82c18cd850592ae9a1f682eb93965a868b5f2f
treec726d0bdaaac4a1c4b492857e5365442d5e261c7
parent5ad07f45dae9d74be8d300aa5fda31cd11c10061
libxc/libxl: sanitize error handling in *_get_max_{cpus, nodes}

In libxc, make xc_get_max_{cpus,node}() always return either a
positive number or -1, and change all the callers to deal with
that.

In libxl, make libxl_get_max_{cpus,nodes}() always return either a
positive number or a libxl error code. Thanks to that, it is also
possible to fix loggig for libxl_{cpu,node}_bitmap_alloc(), which
now happens inside the functions themselves, more accurately
reporting what happened.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_misc.c
tools/libxl/libxl.c
tools/libxl/libxl_utils.c
tools/python/xen/lowlevel/xc/xc.c